<?php
namespace app\common\base;

use app\common\base\BaseController;
use think\controller\Rest;
use thinkcms\auth\Auth;
use think\Response;
use think\exception\HttpResponseException;


class BasicRest extends BaseController
{
    public static $uid;

    public function __construct(){
        parent::__construct();
//        $auth                   = new Auth();
////        $auth->noNeedCheckRules = ['manage/index/index','appadmin/index/home'];
//        $user                   = $auth::is_login();
//        if($user){//用户登录状态
//            self::$uid = $user['uid'];
//            if(!$auth->auth()){
//                $response = Response::create(['status'=>0,'message'=>'您没有权限'], 'json')->header([]);
//                throw new HttpResponseException($response);
//            }
//        }else{
//            $response = Response::create(['status'=>0,'message'=>'您没有登录'], 'json')->header([]);
//            throw new HttpResponseException($response);
//        }
    }
}